<?php
	require '../utils/conn.php';
	
	$topicId = $_REQUEST['topicId'];
	$setId = $_REQUEST['setId'];
	$type = $_REQUEST['type'];
	
	$query = "DELETE FROM t_topic WHERE t_id=".$topicId;
	mysql_query($query);
	
	$topicStr;
	if ($type == 1) {
		$topicStr = listening_id;
	}
	elseif ($type == 2) {
		$topicStr = reading_id;
	}
	elseif ($type == 3) {
		$topicStr = speaking_id;
	}
	elseif ($type == 4) {
		$topicStr = writing_id;
	}
	
	$query = "UPDATE t_set SET ".$topicStr."=-1 WHERE s_id=".$setId;
	mysql_query($query);

?>